package com.ssy.mall.util;

import com.ssy.mall.common.Constant;
import org.apache.tomcat.util.codec.binary.Base64;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * @author: ssy
 * @date:   2021/11/16   加密工具
 * @description
 */
public class MD5Utils {
    public static String getMD5Str(String strValue) throws NoSuchAlgorithmException {
        MessageDigest md5 =MessageDigest.getInstance("MD5");
//      public static final String SALT = "8s4hfkdejkkfmk;,./[-=]'/da1hjnvmka2u8nkj3";
        return Base64.encodeBase64String(md5.digest((strValue+Constant.SALT).getBytes()));
    }



}
